Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

fix: Explicitly provide the host-triple of the version to install #22

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

Phault
Copy link
Contributor

@Phault Phault commented Feb 11, 2024

Rustup has a default-host-triple setting, that may different than the actual host environment. Proto currently don't support these two being different, andit would previously fail to find the executables for the version it had just installed.

While a better solution may to respect Rustup's default-host-triple and support manually specifying the host-triple, this patch at least leaves you with a working installation.

Ran into this because I apparently never ran rustup-init to configure the setting, after installing it on my M1 macbook via Homebrew, so it currently installs x86_64-apple-darwin but Proto looks for aarch64-apple-darwin.

Error log

proto install rust-test 1.76 info: syncing channel updates for '1.76.0-x86_64-apple-darwin' info: latest update on 2024-02-08, rust version 1.76.0 (07dca489a 2024-02-04) info: downloading component 'cargo' info: downloading component 'clippy' info: downloading component 'rust-docs' info: downloading component 'rust-std' info: downloading component 'rustc' 55.1 MiB / 55.1 MiB (100 %) 30.5 MiB/s in 1s ETA: 0s info: downloading component 'rustfmt' info: installing component 'cargo' info: installing component 'clippy' info: installing component 'rust-docs' 14.7 MiB / 14.7 MiB (100 %) 5.4 MiB/s in 1s ETA: 0s info: installing component 'rust-std' 25.3 MiB / 25.3 MiB (100 %) 19.1 MiB/s in 1s ETA: 0s info: installing component 'rustc' 55.1 MiB / 55.1 MiB (100 %) 21.3 MiB/s in 2s ETA: 0s info: installing component 'rustfmt'

1.76.0-x86_64-apple-darwin installed - (timeout reading rustc version)

info: checking for self-update
Error: proto::execute::missing_file

× Unable to find an executable for Rust, expected file ~/.rustup/toolchains/1.76.0-aarch64-apple-darwin/bin/cargo does not exist.

Rustup has a default-host-triple setting, that may different than the
actual host environment. We currently don't support these two being
different, and Proto would previously fail to find the executables for
the version it had just installed.

While a better solution may to respect Rustup's default-host-triple and
support manually specifying the host-triple, this patch at least leaves
you with a working installation.
@milesj
Copy link
Contributor

milesj commented Feb 11, 2024

@Phault The change makes sense. I think we should update like 177 also.

@Phault
Copy link
Contributor Author

Phault commented Feb 11, 2024

@milesj Good catch, I've updated that line as well now.

@milesj milesj merged commit c08adca into moonrepo:master Feb 12, 2024
8 checks passed
@milesj
Copy link
Contributor

milesj commented Feb 12, 2024

Thanks! It may be a while before it lands in proto, so if you need it now, you can manually set the plugin in your config.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants